package com.guaju.yueshangLife.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

public class MineOrder {


    /**
     * code : 200
     * msg : ok
     * data : [{"id":6,"order_number":"20191207193324949262","total_account":"1.00","total_amount":1,"payment_method":1,"paid_at":"2019-12-07 20:56:20","created_at":"2019-12-07 19:33:24","status":"订单完成","status_code":7,"status_comment":"","items":[{"id":9,"product_id":1,"amount":1,"price":"1.00","detail":{"name":"Ace连帽卫衣","cover":{"host":"https://static.nfangxu.com/","path":"images/7a2ca4dce5321e3a5323bb240fd1111f.jpeg"},"attribute":["橙色","XL"]}}]}]
     */

    private int code;
    private String msg;
    private List<DataBean> data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public static class DataBean {
        /**
         * id : 6
         * order_number : 20191207193324949262
         * total_account : 1.00
         * total_amount : 1
         * payment_method : 1
         * paid_at : 2019-12-07 20:56:20
         * created_at : 2019-12-07 19:33:24
         * status : 订单完成
         * status_code : 7
         * status_comment :
         * items : [{"id":9,"product_id":1,"amount":1,"price":"1.00","detail":{"name":"Ace连帽卫衣","cover":{"host":"https://static.nfangxu.com/","path":"images/7a2ca4dce5321e3a5323bb240fd1111f.jpeg"},"attribute":["橙色","XL"]}}]
         */

        private int id;
        private String order_number;
        private String total_account;
        private int total_amount;
        private int payment_method;
        private String paid_at;
        private String created_at;
        private String status;
        private int status_code;
        private String status_comment;
        private List<ItemsBean> items;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getOrder_number() {
            return order_number;
        }

        public void setOrder_number(String order_number) {
            this.order_number = order_number;
        }

        public String getTotal_account() {
            return total_account;
        }

        public void setTotal_account(String total_account) {
            this.total_account = total_account;
        }

        public int getTotal_amount() {
            return total_amount;
        }

        public void setTotal_amount(int total_amount) {
            this.total_amount = total_amount;
        }

        public int getPayment_method() {
            return payment_method;
        }

        public void setPayment_method(int payment_method) {
            this.payment_method = payment_method;
        }

        public String getPaid_at() {
            return paid_at;
        }

        public void setPaid_at(String paid_at) {
            this.paid_at = paid_at;
        }

        public String getCreated_at() {
            return created_at;
        }

        public void setCreated_at(String created_at) {
            this.created_at = created_at;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public int getStatus_code() {
            return status_code;
        }

        public void setStatus_code(int status_code) {
            this.status_code = status_code;
        }

        public String getStatus_comment() {
            return status_comment;
        }

        public void setStatus_comment(String status_comment) {
            this.status_comment = status_comment;
        }

        public List<ItemsBean> getItems() {
            return items;
        }

        public void setItems(List<ItemsBean> items) {
            this.items = items;
        }

        public static class ItemsBean implements Parcelable {
            /**
             * id : 9
             * product_id : 1
             * amount : 1
             * price : 1.00
             * detail : {"name":"Ace连帽卫衣","cover":{"host":"https://static.nfangxu.com/","path":"images/7a2ca4dce5321e3a5323bb240fd1111f.jpeg"},"attribute":["橙色","XL"]}
             */

            private int id;
            private int product_id;

            public int getIs_review() {
                return is_review;
            }

            public void setIs_review(int is_review) {
                this.is_review = is_review;
            }

            private int is_review;
            private int amount;
            private String price;
            private DetailBean detail;


            protected ItemsBean(Parcel in) {
                id = in.readInt();
                product_id = in.readInt();
                amount = in.readInt();
                price = in.readString();
            }

            public static final Creator<ItemsBean> CREATOR = new Creator<ItemsBean>() {
                @Override
                public ItemsBean createFromParcel(Parcel in) {
                    return new ItemsBean(in);
                }

                @Override
                public ItemsBean[] newArray(int size) {
                    return new ItemsBean[size];
                }
            };

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public int getProduct_id() {
                return product_id;
            }

            public void setProduct_id(int product_id) {
                this.product_id = product_id;
            }

            public int getAmount() {
                return amount;
            }

            public void setAmount(int amount) {
                this.amount = amount;
            }

            public String getPrice() {
                return price;
            }

            public void setPrice(String price) {
                this.price = price;
            }

            public DetailBean getDetail() {
                return detail;
            }

            public void setDetail(DetailBean detail) {
                this.detail = detail;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeInt(id);
                dest.writeInt(product_id);
                dest.writeInt(amount);
                dest.writeString(price);
            }

            public static class DetailBean {
                /**
                 * name : Ace连帽卫衣
                 * cover : {"host":"https://static.nfangxu.com/","path":"images/7a2ca4dce5321e3a5323bb240fd1111f.jpeg"}
                 * attribute : ["橙色","XL"]
                 */

                private String name;
                private CoverBean cover;
                private List<String> attribute;

                public String getName() {
                    return name;
                }

                public void setName(String name) {
                    this.name = name;
                }

                public CoverBean getCover() {
                    return cover;
                }

                public void setCover(CoverBean cover) {
                    this.cover = cover;
                }

                public List<String> getAttribute() {
                    return attribute;
                }

                public void setAttribute(List<String> attribute) {
                    this.attribute = attribute;
                }

                public static class CoverBean {
                    /**
                     * host : https://static.nfangxu.com/
                     * path : images/7a2ca4dce5321e3a5323bb240fd1111f.jpeg
                     */

                    private String host;
                    private String path;

                    public String getHost() {
                        return host;
                    }

                    public void setHost(String host) {
                        this.host = host;
                    }

                    public String getPath() {
                        return path;
                    }

                    public void setPath(String path) {
                        this.path = path;
                    }
                }
            }
        }
    }
}
